     package inet.util;
     
     import java.io.PrintStream;
     
     public class Logger
     {
     private static boolean VERBOSE = true;
       private String classname;
     private boolean isLog2File = true;
     private String fileToLog = "log_";
     
       public Logger(String classname)
       {
       this.classname = "";
       this.classname = classname;
       }
     
       public static boolean isVerbose()
       {
       return VERBOSE;
       }
     
       public static void setVerbose(boolean val)
       {
       VERBOSE = val;
       }
     
       public void log(String msg)
       {
       if (!(VERBOSE))
           return;
       System.out.println(msg);       
    //   FileTool.saveToFile(msg.getBytes(), fileToLog + DateProc.Timestamp2YYYYMMDD(DateProc.createTimestamp()) + ".txt");
       }
     
       public void log(String msg, String fileLog) {
       if (VERBOSE)
         {
         System.out.println(msg);
         }
       if (this.isLog2File)
    	 System.out.println("Save to File");
         FileTool.saveToFile(msg, fileLog + DateProc.Timestamp2YYYYMMDD(DateProc.createTimestamp()) + ".txt");
       }
     
       public void error(String msg)
       {
       if (VERBOSE) {
        System.out.println("[ERROR] [" + this.classname + "] " + msg);
         }
       if (this.isLog2File)
    	   System.out.println("in ra file");
         FileTool.saveToFile(msg, this.fileToLog + DateProc.Timestamp2YYYYMMDD(DateProc.createTimestamp()) + ".txt"); 
       }
     
       public void error(String msg, String fileLog) {
       if (VERBOSE) {
         System.out.println("[ERROR] [" + this.classname + "] " + msg);
         }
     
       if (this.isLog2File)
         FileTool.saveToFile(msg, fileLog + DateProc.Timestamp2YYYYMMDD(DateProc.createTimestamp()) + ".txt");
       }
     
       public boolean isLog2File() {
       return this.isLog2File;
       }
     
       public void setLog2File(boolean isLog2File) {
       this.isLog2File = isLog2File;
       }
       
       public static void main (String args[]){
    	//   logger = new Logger(super.getClass().getName());
       }
     }

